<?php
use yii\helpers\Html;
use yii\helpers\Url;
use app\lib\WeixinUtils;

/* @var $this yii\web\View */
/* @var $content string 字符串 */


$web = Url::to("@web");

?>
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <title>分类</title>
    <link rel="stylesheet" href="<?=$web?>/css/bag/goods_category.css" />
    <link type="text/css" href="<?=$web?>/css/bag/global.css" rel="stylesheet" />
    <script type="text/javascript" src="<?=$web?>/js/jquery.js"></script>
    <script type="text/javascript">
        $(document).ready(function(){
            $(function() {
                // 任何需要执行的js特效
                var w = $(document).width();
                if(w > 414){
                    $(".main").css({"width":"414px","height":"auto","margin-left":"auto","margin-right":"auto"});
                }
            });

        });
        function href_home(categoryStr){

            categoryStr = encodeURI(categoryStr);
            window.location.href = "<?=Url::to(["wx-bag/goods-query"]);?>?category=" + categoryStr;
        }
    </script>
</head>

<body>

<div class="main">
    <div class="name" onclick="href_home('0');">
        <div class="name_left">全部分类</div>
        <div class="name_right"></div>
    </div>
    <?php
        foreach($categoryList as &$category){
            ?>
            <div class="name" onclick="href_home('<?=$category['NAME']?>');">
                <div class="name_left"><?=$category['NAME']?></div>
                <div class="name_right"></div>
            </div>

            <?php
        }

    ?>
    <!--<div class="name">
        <div class="name_left">钟表</div>
        <div class="name_right">〉</div>
    </div>-->

</div>

</body>
</html>

